<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="list-form" class="form-horizontal" >
    <div class="form-group">
        <label  class="control-label col-xs-12 col-sm-2">{:__('Reamrk')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="reamrks" data-rule="required" class="form-control" name="reamrk" type="text" style="height:200px;"></textarea>
        </div>
    </div>
    <input type="hidden" name="id" id="id" value="{$id}">
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button  class="btn btn-success btn-embossed " id="yess">通过</button>
            <button  class="btn btn-default btn-embossed" id="no">拒绝</button>
        </div>
    </div>
</div>
<script src="__PUBLIC__assets/js/jquery-1.11.3.min.js"></script>
<script>
    $(function () {
        $('#yess').click(function () {
            var reamrk = $('#reamrks').val(),
                id=$('#id').val();
            $.ajax({
                url: "{:url('bottle.collect/modify')}",
                type:'POST',
                data: {'ids': id,'reamrk':reamrk,'status':2},
                success: function (res) {
                    if(res.code>0){
                        layer.alert(res.msg, function () {
                            parent.location.reload();
                        });
                    }else{
                        layer.alert(res.msg);
                    }

                }
            });
        })
        $('#no').click(function () {
            var reamrk = $('#reamrks').val(),
                id=$('#id').val();
            $.ajax({
                url: "{:url('bottle.collect/modify')}",
                type:'POST',
                data: {'ids': id,'reamrk':reamrk,'status':3},
                success: function (res) {
                    if(res.code>0){
                        layer.alert(res.msg, function () {
                            parent.location.reload();
                        });
                    }else{
                        layer.alert(res.msg);
                    }
                }
            });
        })

    })
</script>
</body>
</html>